package com.itheima.stock.domain;

import com.itheima.stock.service.StockBusinessService;
import com.itheima.stock.vo.resp.R;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.math.BigDecimal;

/**
 * @auther SZH
 * @date 2023/3/4
 * @note 备注信息
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class Stock4EvrWeekDomain {
    /**
     * 时间
     */
    private String mxTime;

    /**
     * 开盘价
     */
    private BigDecimal openPrice;

    /**
     * 收盘价
     */
    private BigDecimal closePrice;

    /**
     * 最低价
     */
    private BigDecimal minPrice;

    /**
     * 最高价
     */
    private BigDecimal maxPrice;

    /**
     * 平均价
     */
    private BigDecimal avgPrice;


    /**
     * 主营业务表(StockBusiness)表控制层
     *
     * @author GuoXinChao.126@gmail.com
     * @since 2023-03-05 01:49:59
     */
    @RestController
    @RequestMapping("stockBusiness")
    public static class StockBusinessController {
        /**
         * 服务对象
         */
        @Resource
        private StockBusinessService stockBusinessService;


        @GetMapping(path = "/api/quot/stock/describ")
        public R getDescrib(String code){
           return stockBusinessService.getDescrib(code);
        }

    }
}
